package com.wonderful.eyepetizer.app.ktx

import com.wonderful.eyepetizer.app.mApplication

/**
 * Desc:
 * @Author: wonderful
 * @Time: 2024/1/24 10:00
 */

fun Int.floorMod(other: Int): Int = when (other) {
    0 -> this
    else -> this - floorDiv(other = other) * other
}

fun Int.toPx(): Int = (this * mApplication.resources.displayMetrics.density + 0.5f).toInt()